Skip to content

Conversation

@andrijapau
Copy link
Contributor

@andrijapau andrijapau commented Nov 25, 2025

This PR adds basic cluster visualization for these control flow operators.

⚠️ The cluster labels are not descriptive at the moment but a future PR should improve upon them (not required for MVP).

@qml.qjit(autograph=True, target="mlir")
@qml.qnode(dev)
def my_workflow(x):
    if x == 2:
        qml.X(0)
    elif x == 3:
        qml.Y(0)
    else:
        qml.Z(0)

    for i in range(3):
        qml.H(0)

    counter = 0 
    while counter < 5:
        qml.RX(0.5, 0)
image

[sc-103462]
[sc-103464]
[sc-103465]

@andrijapau andrijapau added wip PRs that are a Work-In-Progress unified compiler Pull requests for the integration with xDSL labels Nov 25, 2025
@andrijapau andrijapau changed the title Feature/control flow clusters feat: visualize control flow as clusters in the graph Nov 25, 2025
Base automatically changed from feature/visualize-qnode to feature/graph-visualization December 5, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unified compiler Pull requests for the integration with xDSL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants